package cc.aiee.zalopay.core.pojo.vo;

import lombok.Data;

@Data
public class ZalopayVO {

	private String return_code;
	private String return_message;
	private String sub_return_code;
	private String sub_return_message;

	public Integer getReturnCode() {
		if (return_code == null) {
			return -1;
		}
		return Integer.valueOf(return_code);
	}

	public Integer getSubReturnCode() {
		if (sub_return_code == null) {
			return 0;
		}
		return Integer.valueOf(sub_return_code);
	}

	/**
	 * 
	 * @return true:(return_code==1 && sub_return_code==1)
	 */
	public boolean isSuccessful() {
		return getReturnCode() == 1 && getSubReturnCode() == 1;
	}

}
